package homework3.exp2;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @author fengq
 */
public class Test2 {

	public static void main(String[] args) {
		try {
			FileWriter fw = new FileWriter("D:\\Hello02.txt");
			BufferedWriter bw = new BufferedWriter(fw);
			bw.write("大家好！");
			bw.write("我正在学习BufferedWriter");
			bw.newLine();
			bw.write("请多多执教！");
			bw.newLine();
			bw.flush();
			bw.close();
			fw.close();
			System.out.println("执行成功！");
		} catch(IOException e) {
			System.out.println("文件不存在！");
		}
	}

}
